
// 获取全局应用程序实例对象
// const app = getApp();

// 组件基础代码
Component({
  behaviors: [],
  properties: {},
  data: {
  	show: false,
  	clasName: 'hidden',
  	type: -1,
  	order: 1,
  	range: 5
  },
  methods: {
  	chooseType(evt){
		let {type} = evt.currentTarget.dataset;
  		this.setData({
  			'type': type
  		});
  	},
  	chooseOrder(evt){
  		let {order} = evt.target.dataset;
  		this.setData({
  			'order': order
  		});
  	},
  	chooseRange(evt){
  		let {range} = evt.target.dataset;
  		this.setData({
  			'range': range
  		});
  	},
  	showFilter(){
  		let {show,className} = this.data;
  		this.setData({
			'show': !show,
			'clasName': !show?'shown':'hidden'
		});
  	},
  	resetFilter(){
  		this.setData({
  			'order': '',
  			'range': ''
  		});
  	},
  	submitFilter(){
  		this.setData({
  			'show': false,
  			'clasName': 'hidden'
  		});
  		let {type,order,range} = this.data;
  		console.log(`${type},${order},${range}`);
  	}
  }
});
